using System;
using FytSoa.Common.Utils;
using System.ComponentModel.DataAnnotations;
using FytSoa.Application.Hr;
using FytSoa.Application.Sys;
using FytSoa.Common.Enum;
using FytSoa.Domain;
using FytSoa.Domain.Crm;
using SqlSugar;

namespace FytSoa.Application.Erp;

/// <summary>
/// erp-报销信息
/// </summary>
public class ErpFinanceReimbursementDto : AppEntity
{
    /// <summary>
    /// 编号
    /// </summary>
    [Required]
    [StringLength(50)]
    public string Number { get; set; }

    /// <summary>
    /// 报销类型
    /// </summary>
    [Required]
    public long TypeId { get; set; } = 0;
    
    /// <summary>
    /// 报销类型
    /// </summary>
    public SysCodeSimpleDto TypeObj { get; set; } 

    /// <summary>
    /// 报销申请人
    /// </summary>
    [Required]
    public long EmployeeId { get; set; }
    
    /// <summary>
    /// 报销申请人
    /// </summary>
    public HrEmployeeSimpleDto Employee { get; set; }

    /// <summary>
    /// 报销金额
    /// </summary>
    [Required]
    public decimal Amount { get; set; }

    /// <summary>
    /// 付款方式
    /// </summary>
    [Required]
    public long ModeId { get; set; }
    
    /// <summary>
    /// 付款方式
    /// </summary>
    public SysCodeSimpleDto ModeObj { get; set; } 

    /// <summary>
    /// 付款时间
    /// </summary>
    [Required]
    public DateTime PayTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 相关文件
    /// </summary>
    public List<FileBase> Files { get; set; } = new();

    /// <summary>
    /// 备注说明
    /// </summary>
    public string Remark { get; set; }
    
    /// <summary>
    /// 审批流程
    /// </summary>
    [Required]
    public long FlowId { get; set; } = 0;

    /// <summary>
    /// 审批流程详情
    /// </summary>
    [Required]
    public ErpFlowDto.ErpFlowSimpleDto Flow { get; set; } = new();

    /// <summary>
    /// 审核状态
    /// </summary>
    [Required]
    public ErpAuditEnum Status { get; set; } = 0;

    /// <summary>
    /// 创建人
    /// </summary>
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Required]
    public DateTime CreateTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 更新人
    /// </summary>
    public string UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }


}